#!/usr/bin/python
#coding:utf-8

from __future__ import unicode_literals

from django.db import models
from ckeditor.fields import RichTextField
from ckeditor_uploader.fields import RichTextUploadingField

# Create your models here.

class tailor(models.Model):
    sex_choices = ((1, u'男'),(2, u'女'))
    status_choices = ((0,u'默认'),(1,u'启用'),(2,u'不可用'))
    credentials_type_choices = ((1,u'身份证'),(2,u'护照'))

    add_time = models.DateTimeField('添加时间', auto_now_add=True)
    email = models.CharField('邮箱', max_length=200)
    wechat = models.CharField('微信号', max_length=20, blank=True)
    age = models.IntegerField('年龄', blank=True)
    day_price = models.IntegerField('每天价格', blank=True)
    cellphone = models.CharField('电话', max_length=20, blank=True)
    nickname = models.CharField('昵称', max_length=20, blank=True)
    sex = models.SmallIntegerField("性别",choices=sex_choices)

    login_fail_times = models.IntegerField('登录失败次数', blank=True)
    status = models.IntegerField("状态", choices=status_choices)
    score = models.IntegerField('评分', blank=True)
    paid_number = models.IntegerField('已成交订单数', blank=True)
    current_residence = models.CharField('居住地',max_length=20, blank=True)
    service_range = models.CharField('服务地', max_length=20, blank=True)
    credentials_type = models.SmallIntegerField('证件类型', choices=credentials_type_choices)
    credentials_number = models.CharField('证件号', max_length=200, blank=True)

    head_image = models.ImageField('头像');

    #head_image_data = models.
    introduction = RichTextUploadingField('定制师介绍')

    class Meta:
        verbose_name_plural = '定制师列表'
        db_table = 'tailor'

    def __unicode__(self):
        return self.nickname




